package com.park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.park.entity.BlackList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BlackListMapper extends BaseMapper<BlackList> {
    @Select("SELECT * FROM black_list where blacklist_car_id like concat('%', #{id}, '%') LIMIT #{start},#{end}")
    List<BlackList> getByBlackListCarId(@Param("id") String id, @Param("start") int start, @Param("end")int end);

    @Select("SELECT COUNT(1) FROM black_list where blacklist_car_id like concat('%', #{id}, '%')")
    int getBlackListPage(@Param("id") String id);
}
